Skip to content

Conversation

@n7studios
Copy link
Contributor

Summary

Adds validation and sanitization to the args section of register_rest_route, ensuring the WP REST API validates and sanitizes inputs before using the callback.

This ensures correct HTTP status codes are returned e.g. 400 for when an invalid request is made vs. the current 500 server error, which is inaccurate.

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Jan 26, 2026
@github-actions
Copy link

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team January 26, 2026 12:06
@n7studios n7studios marked this pull request as ready for review January 26, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants